package com.donger.business.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.donger.business.modules.upms.entity.SysConfig;
import com.donger.business.modules.upms.mapper.SysConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "sysBaseApi")
public class SysBaseApiImpl implements SysBaseApi {
    @Autowired
    private SysConfigMapper sysConfigMapper;

    @Override
    public String getConfig(String key) {
        SysConfig sysConfig = sysConfigMapper.selectOne(new LambdaQueryWrapper<SysConfig>()
                .eq(SysConfig::getParamKey, key)
        );
        return sysConfig != null? sysConfig.getParamValue() : null;
    }
}
